home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Educational / MolViewer / Source / Mtypes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-12  |  3.0 KB  |  106 lines

  1. /* Mtypes.h - Copyright 1993 Steve Ludtke */
  2. /* This file contains type definitions required by various classes */
  3.  
  4. #include <3Dkit/3Dkit.h>
  5.  
  6. #define SQR(x) ((x)*(x))
  7.  
  8. /* SelectView */
  9. #define MAXTEXT 50
  10.  
  11. struct SELDAT {
  12.     char text[MAXTEXT];    /* text to display for each line */
  13.     short sel;            /* number selected, ie - 1st selected=1 */
  14.     short stab;            /* sort of a separate array containing an ordered */
  15.                         /* of the selected cells */
  16. };
  17.  
  18. /* MolObj */
  19. #define MAXMOL 2        /* max # of molecules, currently only 1 supported */
  20. #define MAXAA 100        /* max # amino acids/molecule */
  21. #define NEL 84            /* # elements in data file */
  22.  
  23. typedef struct { float x,y,z; } Vec;    /* vector structure corresponding */
  24.                                         /* to RtPoint */
  25.  
  26. /* element information from covalent.dat */
  27. struct ELINFO {
  28. char name[2];
  29. float rad;
  30. float arad;
  31. RtColor color;
  32. id image;
  33. };
  34.  
  35. /* a bond between atoms */
  36. struct LBOND {
  37. int n1,n2;        /* the 2 atoms which are bonded */
  38. float d,w;        /* currently unused, length and weight of bond */
  39. char type;        /* bond type, not used consistently yet */
  40. };
  41.  
  42. /* an atom */
  43. struct ATOM {
  44. unsigned char anum,cnum;    /* atomic number and atom # within residue */
  45. char type[3];                /* additional atom type info, inconsistent usage */
  46. short numb,bnd[4];            /* atoms bonded to this one, max 4 for now */
  47. float bndl[4];                /* length of each bond, not used (?) */
  48. char tag,sel;                /* flags used for molecule manipulations */
  49. };
  50.  
  51. /* an amino acid */
  52. struct AMINO {
  53. short n,c1,c2,cn,cn2,h,o,sc;    /* points to individual atoms in the  */
  54.                                 /* backbone for dihedral calcs. */
  55. float phi,psi,omega;    /* dihedrals, standard IUPAC definition */
  56. short anum;                /* type of amino acid (# in acid[] array) */
  57. char sel;                /* flag used for manipulations */
  58. };
  59.  
  60. typedef struct ATOM Atom;
  61.  
  62. /* molecule structure, currently the program only supports one molecule */
  63. /* at a time */
  64. struct MOLECULE {
  65. Atom *atom;                /* array of atoms in the molecule */
  66. RtPoint *coord;            /* atom coordinates, seperate from atom struct. */
  67.                         /* for drawing efficiency */
  68. struct LBOND *lb;        /* table of bonds */
  69. int numa,numlb,numaa;    /* number of atoms,bonds, and amino acids */
  70. RtInt *verts,*nverts;    /* array used for quick drawing */
  71. struct AMINO am[MAXAA];    /* array of amino acids, not dynamically alloc yet */
  72. };
  73.  
  74. typedef struct MOLECULE Molecule;
  75.  
  76. /* D3View */
  77. #define TIMESTEP .1        /* Time between updates (in seconds)*/
  78.  
  79. #define DRC (M_PI/180.0)    /* degree->radian conversion */
  80.  
  81. /* structure used in quick drawing mode */
  82. struct DSORT {
  83. RtPoint c;
  84. int anum:31;
  85. int sel:1;
  86. };
  87.  
  88. /* 3d point structure (same as Vec defined above) */
  89. typedef struct {
  90.     float x,y,z;
  91. } Point;
  92.  
  93. /* AminoView */
  94. /* definition of amino acid info structure, currently contains only */
  95. /* 20 of the most common amino acids + unknown */
  96. typedef struct { char *d1,*d2,*d3; long wt; int phob; short nc,ns,no,nn; } ACID;
  97.  
  98. #define AADEF 21    /* number of acids in info table (see AminoView.m) */
  99. #define MAXSEQ 100    /* max # amino acids in AminoView sequence */
  100.  
  101. /* wraps.psw - postscript font selection routines */
  102. void PSsethel();
  103. void PSsetohlfs();
  104. void PSsetsymb();
  105. void PSsetsma();
  106.